package stars.starSystems;

import galaxies.enums.EGalaxyAge;
import gameAppLayer.GameSettings;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Random;

import old.coordinate.CoordinateModel;

import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;


import stars.enums.ESystemMod;
import stars.enums.StarSystemDistributions;
import stars.enums.StarSystemNames;
import utilities.Key;

/*
 * Generates star system object.
 */
public class StarSystemModelBuilder {

	Random rand = new Random();
	
	public StarSystemModelBuilder() {
		
	}
	
	//Only specifies location, systemLayout and name are randomly chosen
	public StarSystemModel createModel(ArrayList<Integer> location, StarSystemDistributions sysDists, 
			StarSystemNames nameList) {
		StarSystemLayoutBuilder layoutBuild = new StarSystemLayoutBuilder();
		String systemLayout = layoutBuild.chooseLayout(sysDists);
		
		String name = nameList.getRandomEntry();		
		StarSystemModel tempModel = this.createModel(location, systemLayout, name);		
		return tempModel;
	}
	
	//Specify location and layout.  Name is randomly chosen
	public StarSystemModel createModel(ArrayList<Integer> location, String systemLayout, StarSystemNames nameList) {
		String name = nameList.getRandomEntry();		
		StarSystemModel tempModel = this.createModel(location, systemLayout, name);		
		return tempModel;		
	}
	
	//Specify location, layout, and name
	public StarSystemModel createModel(ArrayList<Integer> location, String systemLayout, String name) {
		StarSystemModel tempModel;		
		tempModel = new StarSystemModel(location, systemLayout, name);
		//Add any other construction rules here
		return tempModel;
	}
	
	
	
//	private ESystemMod generateSystemMod() {
//		double value = rand.nextDouble();
//		
//		if (value < 0.001) {
//			return ESystemMod.WHITE_DWARF_NOVA;
//		}
//		else
//			return ESystemMod.NONE;
//	}
}
